<?php
$userid = $_POST['param1'];
require('../../cofd/common.php');
$mysqli = $conn;
$exmatfromValue = $userid; 
$stmt = $mysqli->prepare("SELECT lisid,aname,ifzb,ip,score FROM exam_ans WHERE fromexam = ?");
$stmt->bind_param('s', $exmatfromValue); 
$stmt->execute();
$result = $stmt->get_result();
$list = [];
if($result){
    while ($row = $result->fetch_assoc()) {
        $list[] = $row;
    }
    echo json_encode(array('code'=>200,'result'=>$list));
}else{
    echo json_encode(array('code'=>400,'result'=>'获取失败'));
}
$stmt->close();
$mysqli->close();